<%= grid(@user_folders) do |g|
    g.action_column  object_property: :id
    g.column name: '文件夹名称', attribute: 'name' do |user_folder|
      link_to user_folder.name, docs_user_folder_path(user_folder)
    end

    g.column name: '编号',attribute: 'serial_no'

    g.column name: '责任人',attribute: 'owner_id' do |user_folder|
        name_tag user_folder.owner
    end
    g.column name: '所属小组',attribute: 'group_id' do |user_folder|
        name_tag user_folder.group
    end
    g.column name: '小组文件夹',attribute: 'owner_id' do |user_folder|
        link_to user_folder.group_folder.name,user_folders_group_folder_path(user_folder.group_folder)
    end

    
    g.column name: '文档数',attribute: 'docs_count'
   
    g.column name: '创建人',attribute: 'creator_id' do |user_folder|
      name_tag user_folder.creator
    end
    g.column name: '修改时间',attribute: 'updated_at'  do |user_folder|
      time_str user_folder.updated_at
    end
    g.column do |user_folder|
       render :partial => '/user_folders/button', :locals=>{:user_folder=>user_folder}
    end
   
end %>